package com.meij.http;

import org.json.JSONObject;

import android.text.TextUtils;
import android.widget.Toast;

import com.meij.activity.MjActivity;
import com.net.NetCallback;

/***
 * 请求回调的基本实现
 */
public class MJNetCallBack implements NetCallback {
	private MjActivity activity;

	public MJNetCallBack(MjActivity activity) {
		this.activity = activity;
	}

	@Override
	public void onStart() {
		activity.ShowPd();
	}

	@Override
	public void onSuccess(JSONObject object) {
		activity.DismissPd();
	}

	@Override
	public void onFailure(String message) {
		activity.DismissPd();
		if (!TextUtils.isEmpty(message)) {
			Toast.makeText(activity, message, Toast.LENGTH_LONG).show();
		}
	}

}